﻿using System.Linq;
using System.Web.Mvc;
using MVCLD.Models;

namespace MVCLD.Controllers
{
    public class ApplicationController : Controller
    {
        private MVCLDServiceModels db = new MVCLDServiceModels();
        public ApplicationController()
        {
            ViewData["MainCategoryCount"] = db.CountMainCategories();
            ViewData["SubCategoryCount"] = db.CountSubCategories();
            ViewData["LiveArticleCount"] = db.CountArticlesByLiveOrPending(true);
            ViewData["PendingArticleCount"] = db.CountArticlesByLiveOrPending(false);
            ViewData["MainCategories"] = db.GetAllMainCategories().ToList();            
        }
    }
}
